package com.ynunicom.midplatform.sys.permission;

import com.ynunicom.midplatform.common.persistence.entity.AbstractIdEntity;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 系统权限表
 *
 * @author duwei
 */
@Entity
@Table(name = "sys_permission")
@Getter
@Setter
public class SysPermission extends AbstractIdEntity {

    private String name;

    /**
     * 资源类型，[menu|button]
     */
    @Column(columnDefinition = "enum('menu','button')")
    private String resourceType;
    /**
     * 资源路径.
     */
    private String url;
    /**
     * 权限字符串,menu例子：role:*，button例子：role:create,role:update,role:delete,role:view
     */
    private String permission;
    /**
     * 父编号
     */
    private Long parentId;
    /**
     * 父编号列表
     */
    private String parentIds;

    private Boolean available = Boolean.FALSE;

}
